/* 
* @Author: anchen
* @Date:   2015-08-10 15:57:33
* @Last Modified by:   anchen
* @Last Modified time: 2015-08-10 17:43:55
*/

'use strict';
$(function(){
	$("#click").click(function(){
		$(this).alertShow({
		width:"300px",
		height:"250px"
		})
		})
$("#close,#closeImg").click(function(){
	$(this).alertHide({
		width:"0",
		height:"0"
		})
})
    /*遮罩层显示*/
  /*  $("#click").click(function(){
        $("#mask").animate({
            width:"100%",
            height:"100%",
            opacity:"0.5"
            },600,
            function(){
                $("#center")
                .css("display","block")
                .animate({
                    width:"300px",
                    height:"250px",
                },600)
            });
    })
    /*关闭遮罩层*/
  /* $("#close,#closeImg").click(function(){
     $("#center").animate({
					 width:0,
					 height:0
					 },600,
					 function(){
		           $(this).css("display","none")
				   $("#mask").animate({
						   width:0,
						   height:0,
						   opacity:0
						   },600)
				   });
   })*/
 /*输入框聚焦*/
 $("#username,#password").focus(function(){
    if($(this).val()==this.defaultValue)
    {
        $(this).val("");
        $("#content input").css("color","black")
    }
 }).blur(function(){
    if($(this).val()==""){
        $(this).val(this.defaultValue);
        $("#content input").css("color","#ccc")
    }
 }).keyup(function(e){
    if(e.which==13){
        alert('回车提交表单');
    }
 })
 /*表单验证*/

/*$("#content").validate({
        rules: {
            username: {
                required: true,
                minlength: 2
            },
            password:{
                required:true,
                minlength:6
            }
        },
        
        messages: {
            username: {
                required: '请输入姓名',
                minlength: '请至少输入两个字符'
            },
            password:{
            required:'请输入密码',
            minlength:'请至少输入六个字符'
        }
        },  
        
        errorElement: "em", //可以用其他标签，记住把样式也对应修改
        success: function(label) {
            //label指向上面那个错误提示信息标签em
            label.text(" ")             //清空错误提示消息
                .addClass("success");   //加上自定义的success类
        }

      });*/

return false;
})